Printing With QuickDraw GX
From the point of view of your application, printing with QuickDraw GX is not fundamentally different from other types of drawing. The functions you use for drawing to the screen are the same functions you use for sending images to a printer. The
printing component of QuickDraw GX allows you to draw shape objects and to use the information in other objects (such as style, ink, transform, and color set) in the same way you do when drawing to the screen. When printing, the printer is represented by view port and view device objects, just as in other drawing.To control these printing capabilities, your application creates printing-related QuickDraw GX objects before it prints a document for the first time. Your application flattens and stores those objects when it saves the document, and it retrieves and unflattens those objects when it reopens the document. The objects include the job object (the primary holder of printing information), the format object (specifying scaling and page dimensions), and the paper-type object (specifying a paper-type name and dimensions). These objects also include references to collection objects, which are similar to QuickDraw GX objects but are managed by the Collection Manager. The Collection Manager is described in the Collection Manager chapter of Inside Macintosh: QuickDraw GX Environment and Utilities.
QuickDraw GX prepares an document for printing by spooling it, which means flattening its shapes and storing them along with the associated printing objects as a print file. To actually print the document, QuickDraw GX despools the print file and sends its data to the printer. QuickDraw GX can also use the printing process create a portable digital document (PDD), which is a kind of print file that contains sufficient object and font information that it can be displayed or printed on any QuickDraw GX system, regardless of what fonts or printers are installed.
QuickDraw GX printing is based on a message-passing architecture. For
example, QuickDraw GX sends a message when it wants to print a page, display a dialog box on the user's screen, or initialize a job object. Therefore, in addition to manipulating printing objects and collection objects, your application needs to be able to respond to QuickDraw GX messages for some basic printing actions, such as updating windows behind dialog boxes.Printing extensions and printer drivers also use printing messages. A printing extension is an add-on software module that allows you to extend the printing functionality provided by applications and printer drivers. A printer driver controls how the contents of a document are spooled, rendered, and sent to a specific output device. The messaging technology used with QuickDraw GX is described in the Message Manager chapter of Inside Macintosh: QuickDraw GX Environment and Utilities. How printing extensions and printer drivers use printing messages, and information on how to write an extension or driver, are described in Inside Macintosh: QuickDraw GX Printing Extensions and Drivers.
The rest of this section summarizes the QuickDraw GX printing features of most interest to application developers. For more information on printing than is provided here, see Inside Macintosh: QuickDraw GX Printing.
Subtopics
- Core Printing Features
- Custom Dialog Boxes and Page Formats
- Advanced Printing Features
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help